﻿Public Class frmMileageLoad
    Dim ProjectObject As L3DObjectsLibrary.Project

    Public Property Project As L3DObjectsLibrary.Project
        Get
            Return ProjectObject
        End Get
        Set(ByVal value As L3DObjectsLibrary.Project)
            ProjectObject = value
        End Set
    End Property
    Private Sub frmMileageLoad_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim CarEditor As CarFastEditor
        Dim Top As Integer
        For Each ProjectElement As L3DObjectsLibrary.ProjectElement In Project.ProjectElements
            For Each Group As L3DObjectsLibrary.Group In ProjectElement.Groups
                For Each Car As L3DObjectsLibrary.Car In Group.Cars
                    CarEditor = New CarFastEditor
                    With CarEditor
                        .Left = 0
                        .Top = Top
                        Top = Top + .Height
                        .Car = Car
                        .Parent = CarPanel
                    End With
                Next
            Next
        Next
    End Sub

    Private Sub cmdOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOk.Click
        Me.Close()
    End Sub

    Private Sub cmdCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCancel.Click
        For Each Editor As CarFastEditor In CarPanel.Controls
            Editor.Reset()
        Next
        Me.Close()
    End Sub
End Class